package com.example.demo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: H_tao_X
 * Date: 2022-07-25
 * Time: 9:04
 */
@RestController // 返回非静态页面的数据，这里使用的组合注解
public class CalcController {
    @RequestMapping("/calc")
    public String calc(Integer num1,Integer num2) {
        if(num1 == null || num2 == null) return "<h1> 参数错误! </h1>";
        return "<h1>结果：" + (num1 + num2) + "</h1>";
    }
}
